home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Collection of Tools & Utilities
/
Collection of Tools and Utilities.iso
/
graphic
/
rtetc800.zip
/
RTDOCS.ZIP
/
SCN2SFF.LST
< prev
next >
Wrap
File List
|
1992-07-27
|
21KB
|
567 lines
SCN2SFF(1G)
NAME
scn2sff - format conversion program
SYNOPSIS
scn2sff [options] {SCNfile|-} [>SFFfile]
AUTHOR
Antonio Costa, INESC-Norte, 1991 1992
DESCRIPTION
_s_c_n_2_s_f_f command performs conversion between a text format
(SCN) suitable for scene descriptions to another more simple
text format (SFF) that is accepted by the _r_t_r_a_c_e ray-tracer
program. The SCN text file describes objects, lights, sur-
face definitions, textures, etc. The scene format is
described bellow.
OPTIONS
[C]
The parameter _C tells the program to preprocess the input
file through the UNIX standard preprocessor (/usr/lib/cpp
with option -P).
[M]
The parameter _M tells the program to preprocess the input
file through the M4 preprocessor (/usr/bin/m4).
[P"_p_r_e_p_r_o_c_e_s_s_o_r _c_o_m_m_a_n_d"]
The parameter _P tells the program to preprocess the input
file through the command described (for example,
P"/usr/lib/cpp -P -Dabc").
RESTRICTIONS
None for the moment.
BUGS
No bugs known. They have to be hidden deep somewhere, as
usual.
DESCRIPTION
Comments start with % ; or # characters and continue to the
end of the line (so there are no nested comments).
The commands are processed from the start of the scene, and
some have a global effect until they are changed or the
scene is complete. Such commands are _r_e_f_r_a_c_t_i_o_n, _s_u_r_f_a_c_e,
_t_r_a_n_s_f_o_r_m_a_t_i_o_n_s and _t_e_x_t_u_r_e_s; as commands can be nested by
grouping, any command defined inside a group is removed when
that group is finished.
Example:
surface matte white % current surface is matte white
refraction 1.1 % current refraction index
transform rotate x 15 % transformation
group % start of a group of commands
surface matte red % new current surface
transform scale 2 % transformation
sphere 0 0 0 1 % sphere object
ungroup % end of group
% back to matte white surface, refraction 1.1
% scale transformation is removed
ENTITIES
The main entities are:
_i_n_t_e_g_e_r - it can be a simple number, an integer expression
enclosed in parenthesis or the _i_n_t function applied to any
real expression.
_r_e_a_l - a number, a function or an expression enclosed in
parenthesis.
_c_o_l_o_r - a triplet of RGB real values between 0 and 1 (in
certain cases, it is allowed to be greater than 1 or nega-
tive; called _c_o_l_o_r__e_x_t_e_n_d_e_d) or a name (like _r_e_d, _b_l_u_e,
etc).
_p_o_i_n_t - a triplet of XYZ values (numbers, functions or
expressions).
_v_e_c_t_o_r - similar to point, but the 3 components cannot be
simultaneously equal to 0.
_f_i_l_e_n_a_m_e - a set of characters with no blanks between.
_e_x_p_r_e_s_s_i_o_n - anything enclosed in parenthesis. Operators are
+, -, *, /, ^ (exponentiation) and | (remainder).
_f_u_n_c_t_i_o_n - there are many functions available: _i_n_t _s_i_n _c_o_s
_t_a_n _a_s_i_n _a_c_o_s _a_t_a_n _s_q_r_t _r_t_o_d _d_t_o_r _e_x_p _l_o_g _a_b_s _m_a_x _m_i_n. There
also some functions that operate with vectors and return a
number (_d_o_t_v_e_c_t_o_r) and some that return a vector or point
(_n_o_r_m_v_e_c_t_o_r _a_d_d_v_e_c_t_o_r _d_i_f_f_v_e_c_t_o_r _s_c_a_l_e_v_e_c_t_o_r _c_r_o_s_s_v_e_c_t_o_r).
There is also an operator _m_o_n_o that converts from a value to
3 identical values (good for specifying monochromatic
colors).
GENERAL COMMANDS
The main commands are:
_e_y_e (_f_r_o_m) point - default {5,0,0}.
_l_o_o_k (_a_t) point - default {0,0,0}.
_u_p vector - default {0,1,0}.
_a_n_g_l_e (_f_o_v) horizontal [vertical] - half aperture view in
degrees (default 22.5 degrees).
_b_a_c_k_g_r_o_u_n_d color - the color of the background, at infinite
distance (default light_sky_blue).
_a_m_b_i_e_n_t color - the diffuse light that illuminates the whole
scene (default is {0.1,0.1,0.1}).
_r_e_f_r_a_c_t_i_o_n (_i_o_r) index - default is 1.
_g_r_o_u_p ... _u_n_g_r_o_u_p - anything enclosed is only defined inside
the block, ie, it does not apply outside.
LIGHT COMMANDS
The commands for definition of light sources are:
_l_i_g_h_t _p_o_i_n_t point [color_extended] - default color for
lights is white.
_l_i_g_h_t _d_i_r_e_c_t_i_o_n_a_l vector [color].
_l_i_g_h_t _s_p_o_t point vector color_extended [angle [factor]] -
the light illuminates inside a cone defined by the angle
(default 45 degrees) and the transition can be sharp if fac-
tor is near 1 or smooth if factor >> 1 (default 1).
_l_i_g_h_t _e_x_t_e_n_d_e_d point color_extended radius samples - a
spherical light (it is sampled by samples^2 rays).
SURFACE COMMANDS
The commands for definition of surfaces are:
_s_u_r_f_a_c_e color [diffusion specularity phong metalness [tran-
sparency]] - phong and metalness are values, the others are
colors (defaults {0.9,0.9,0.9} {0.1,0.1,0.1} 3 0
{0.1,0.1,0.1} or transparency only {0,0,0}).
_s_u_r_f_a_c_e _s_t_r_a_u_s_s color smoothness metalness [transparency] -
all colors (default transparency is {0,0,0}).
_s_u_r_f_a_c_e _m_a_t_t_e color - all diffuse surface.
_s_u_r_f_a_c_e _p_l_a_s_t_i_c color smoothness phong - surface with big
diffusion, small specularity and small phong factor.
_s_u_r_f_a_c_e _m_e_t_a_l color smoothness phong - surface with small
diffusion, big specularity, big phong factor and metalness
factor equal to 1.
_s_u_r_f_a_c_e _d_i_e_l_e_c_t_r_i_c color transparency refraction - tran-
sparent surface with no diffusion, some specularity, large
phong factor and null metalness.
_s_u_r_f_a_c_e _g_l_a_s_s color transparency - transparent surface with
refraction index equal to 1.52, approximately.
OBJECT COMMANDS
The commands for objects are of the form
_o_b_j_e_c_t object_data
or else with local commands that apply only to itself of the
form
_o_b_j_e_c_t [attributes ... _d_a_t_a] object_data.
_s_p_h_e_r_e center radius.
_b_o_x center sizes - this is an axis-aligned box.
_c_u_b_e center size - again it is axis-aligned.
_c_o_n_e apex base base_radius - closed cone.
_c_o_n_e _o_p_e_n apex base base_radius.
_c_y_l_i_n_d_e_r apex base radius - closed cylinder.
_c_y_l_i_n_d_e_r _o_p_e_n apex base radius.
_c_o_n_e _t_r_u_n_c_a_t_e_d apex apex_radius base base_radius - closed.
_c_o_n_e _t_r_u_n_c_a_t_e_d _o_p_e_n apex apex_radius base base_radius.
_w_e_d_g_e point point point depth - defined by a triangular face
and depth (face is defined counterclockwise so that depth is
measured in the opposite direction of Rigth Hand Rule thumb;
this convention also applies to other objects).
_t_e_t_r_a point point point point.
_p_r_i_s_m depth number_vertices point ... point - closed prism.